package com.lgx.common.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.lgx.common.basic.dao.GeneralDao;
import com.lgx.common.dao.ISystemConfigDao;
import com.lgx.common.entity.SystemConfig;

@Component
public class SystemConfigDao extends GeneralDao implements ISystemConfigDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<SystemConfig> findSystemConfigList() {
		return this.getHibernateTemplate().find("from SystemConfig ");
	}

	@Override
	public SystemConfig findSystemConfigByCode(String code) {
		@SuppressWarnings("unchecked")
		List<SystemConfig> scs = this.getHibernateTemplate().find("from SystemConfig where code = '"+code+"'");
		return scs.size()>0?scs.get(0):null;
	}

}
